<?php

namespace app\admin\controller;

use app\BaseController;
use app\service\admin\AdminRoleLogic;
use think\facade\Session;

class Index extends BaseController
{
    public function index()
    {
        $roleId = Session::get('role_id');
        $realName = Session::get('real_name');
        $arrMenus = AdminRoleLogic::getInstance()->getMenuList($roleId);
        return view('', compact('realName', 'arrMenus'));
    }

    public function welcome()
    {
        if (empty(Session::get('admin_id'))) {
            return redirect('/admin/login/index');
        }
        $realName = Session::get('real_name');
        return view('', ['realName' => $realName]);
    }
}